/*
 * level1.h
 *
 * Copyright (c) 2009, Eugen Stoian <stoian.e@gmail.com>
 * 
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 * 
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 * http://www.fsf.org/licensing/licenses/lgpl.txt
 */


#ifndef LEVEL1_H_
#define LEVEL1_H_
#ifdef __cplusplus
extern "C" {
#endif

/*
 * SUM
 */
void ssum(int n, const float* x, const float* y, float* result);
void dsum(int n, const double* x, const double* y, double* result);

/*
 * ASUM
 */
void sasum(int n, const float* x, const float* y, float* result);
void dasum(int n, const double* x, const double* y, double* result);

/*
 * DOT PRODUCT
 */
float sdot(int n, const float* x, const float* y);
double ddot(int n, const double* x, const double* y);

/*
 * EUCLIDEAN NORM
 */
float snrm2(int n, const float* x);
double dnrm2(int n, const double* x);

/*
 * y <- a*x+y
 */
void saxpy(int n, float a, const float* x, float* y);
void daxpy(int n, float a, const double* x, double* y);

/*
 * x <- a*x
 */
void sscale(int n, float a, float* x);
void dscale(int n, double a, double* x);

/*
 * IAMAX
 */
int samax(int n, const float* x);
int damax(int n, const double* x);

#ifdef __cplusplus
}
#endif
#endif /* LEVEL1_H_ */
